Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <ul><li>Coffee</li><li id="myLI">Tea</li><li>Milk</li></ul> <p>Click the button to remove the li element with id="myLI" from the list.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var item = document.getElementById("myLI"); item.parentNode.removeChild(item); } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_removechild3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:28:58 GMT --> </html>
Result:
Try it Yourself - © w3schools.com